package com.tengju.user.infrastructure.repository.convert;

import com.tengju.user.domain.model.csm.dealer.CrmDealerInfo;
import com.tengju.user.domain.model.user.StarLevelEnum;
import com.tengju.user.domain.model.user.UserApplayTypeEnum;
import com.tengju.user.domain.model.user.UserLevelEnum;
import com.tengju.user.infrastructure.persistence.mybatis.dataobject.CrmDealerDO;

/**
 * @Auther: kezunfa
 * @Date: 2021/4/22 15:58
 * @Description:
 */
public class CrmDealerInfoConvert {

    public static CrmDealerInfo toModel(CrmDealerDO crmDealerDO) {
        if (crmDealerDO == null) {
            return null;
        }
        CrmDealerInfo crmDealerInfo = new CrmDealerInfo();
        crmDealerInfo.setIdCode(crmDealerDO.getIdCode());
        crmDealerInfo.setUserName(crmDealerDO.getUserName());
        crmDealerInfo.setMobile(crmDealerDO.getMobile());
        crmDealerInfo.setNickName(crmDealerDO.getNickName());
        crmDealerInfo.setLevel(UserLevelEnum.getByCode(crmDealerDO.getLevel()));
        crmDealerInfo.setLevelChgAt(crmDealerDO.getLevelChgAt());
        crmDealerInfo.setApplyType(UserApplayTypeEnum.getByCode(crmDealerDO.getApplyType()));
        crmDealerInfo.setUserCountry(crmDealerDO.getUserCountry());
        crmDealerInfo.setUserProvince(crmDealerDO.getUserProvince());
        crmDealerInfo.setUserCity(crmDealerDO.getUserCity());
        crmDealerInfo.setSupIdCode(crmDealerDO.getSupIdCode());
        crmDealerInfo.setSupUserName(crmDealerDO.getSupUserName());
        crmDealerInfo.setSupNickName(crmDealerDO.getSupNickName());
        crmDealerInfo.setAsscHkIdCode(crmDealerDO.getAsscHkIdCode());
        crmDealerInfo.setAsscHkName(crmDealerDO.getAsscHkName());
        crmDealerInfo.setAsscHkNickName(crmDealerDO.getAsscHkNickName());
        crmDealerInfo.setInviteCode(crmDealerDO.getInviteCode());
        crmDealerInfo.setStarLevel(StarLevelEnum.parseByCode(crmDealerDO.getStarLevel()));

        crmDealerInfo.setBlStar1IdCode(crmDealerDO.getBlStar1IdCode());
        crmDealerInfo.setBlStar1Name(crmDealerDO.getBlStar1Name());
        crmDealerInfo.setBlStar2IdCode(crmDealerDO.getBlStar2IdCode());
        crmDealerInfo.setBlStar2Name(crmDealerDO.getBlStar2Name());

        crmDealerInfo.setBlStar3IdCode(crmDealerDO.getBlStar3IdCode());
        crmDealerInfo.setBlStar3Name(crmDealerDO.getBlStar3Name());
        crmDealerInfo.setBlStar4IdCode(crmDealerDO.getBlStar4IdCode());
        crmDealerInfo.setBlStar4Name(crmDealerDO.getBlStar4Name());

        crmDealerInfo.setBlEcIdCode(crmDealerDO.getBlEcIdCode());
        crmDealerInfo.setBlEcName(crmDealerDO.getBlEcName());

        crmDealerInfo.setBlSecIdCode(crmDealerDO.getBlSecIdCode());
        crmDealerInfo.setBlSecName(crmDealerDO.getBlSecName());

        crmDealerInfo.setBlClubId(crmDealerDO.getBlClubId());
        crmDealerInfo.setBlClubName(crmDealerDO.getBlClubName());

        crmDealerInfo.setAreaHkCnt(crmDealerDO.getAreaHkCnt());
        crmDealerInfo.setAreaSvipCnt(crmDealerDO.getAreaSvipCnt());
        crmDealerInfo.setAreaVvipCnt(crmDealerDO.getAreaVvipCnt());
        crmDealerInfo.setAreaVipCnt(crmDealerDO.getAreaVipCnt());
        crmDealerInfo.setAreaRuCnt(crmDealerDO.getAreaRuCnt());

        crmDealerInfo.setCustHkCnt(crmDealerDO.getCustHkCnt());
        crmDealerInfo.setCustSvipCnt(crmDealerDO.getCustSvipCnt());
        crmDealerInfo.setCustVvipCnt(crmDealerDO.getCustVvipCnt());
        crmDealerInfo.setCustVipCnt(crmDealerDO.getCustVipCnt());
        crmDealerInfo.setCustRuCnt(crmDealerDO.getCustRuCnt());

        return crmDealerInfo;
    }
}
